package com.ld.admin.websocket.chat.model;

import lombok.Data;

/**
 * 用户
 * 
 * @ClassName ChatUserModel
 * @author <a href="mailto:donggongai@126.com" target="_blank">吕凯</a>
 * @date 2019年2月27日 上午10:48:39
 *
 */
@Data
public class ChatUserModel implements java.io.Serializable {
    private String msgType = "user";
    private static final long serialVersionUID = 369932267893521855L;

    private Long id;
    private String loginName;
    private String realName;
    private String idNo; // 识别号码，用于同一用户登录
    private String ip; // ip
    private String client = ""; // 客户端信息，如浏览器类型

    private String room;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        ChatUserModel other = (ChatUserModel) obj;
        if (id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!id.equals(other.id)) {
            return false;
        }
        if (idNo == null) {
            if (other.idNo != null) {
                return false;
            }
        } else if (!idNo.equals(other.idNo)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + ((idNo == null) ? 0 : idNo.hashCode());
        return result;
    }

}
